// 男女
export const genderGroup = [
  { value: '男', key: 'M' },
  { value: '女', key: 'F' },
]

export const durationGroup = reactive([
  { value: '1天', key: 1 },
  { value: '2天', key: 2 },
  { value: '3天', key: 3 },
  { value: '7天', key: 7 },
  { value: '30天', key: 30 },
])

// 增益数组
export const gainGroup = reactive([
  { name: '2.5mm/mV', id: 2.5 },
  { name: '5mm/mV', id: 5 },
  { name: '10mm/mV', id: 10 },
  { name: '20mm/mV', id: 20 },
])

// 走速数组
export const speedGroup = reactive([
  { name: '5mm/s', id: 5 },
  { name: '10mm/s', id: 10 },
  { name: '25mm/s', id: 25 },
  { name: '50mm/s', id: 50 },
])

export const getVal = (arr, _importVal, output = "value", key = "key") => {
  if (_importVal === undefined || _importVal === null || _importVal === "") return null;
  const findIndex = arr.findIndex(o => o[key] === _importVal);
  if (findIndex === -1) return null;
  return arr[findIndex][output];
};
